This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal


Feb 16, 2016, 2:02 PM
3 Posts

How to crash a server with a Variant

  • Category: Domino Server
  • Platform: Windows
  • Release: 9.0.1
  • Role: Administrator,Developer
  • Tags: Crash
  • Replies: 0

Dear All

 

Here below an agent source code to crash a server or a client

The expected error should be “object variable not set” or “type mismatch” instead of crashing any process.
Indeed, the GetDB() function trigger an error, then the DB() singleton which is a variant isn’t set, and the command line “Set DB = singleton” try to set as output an empty variant.
Finally when the agent call msgbox DB().title, the server/client crash.


Hope a fixpack will be provided soon.

Option Public
Option Declare
%REM
    Agent DOO_Crash
    Created Jan 29, 2011 by e_bdetar
    Description: Agent to cause server crash
%END REM


Sub Initialize()
    
    Call crash()

    
    
End Sub

 

%REM
    Function getDB
    Description: Return an error
    Return : NotesDatabase
%END REM
Function getDB As NotesDatabase
On Error GoTo handleError

    Dim rc As NotesDatabase

Error 1000, "test crash"

GoTo handleExit
    
handleError:
    On Error Resume Next
    
handleExit:
    Set getDB = rc
End Function

 


%REM
    Property Get DB
    Description: Singleton to retrieve a notesdatabase
%END REM
Static Property Get DB As NotesDatabase
    On Error GoTo handleError

    Static singleton As Variant

    If IsEmpty(singleton) Then
        Set singleton = getDB() 
    End If


    GoTo handleExit
    
handleError:
    On Error Resume Next
    
handleExit:
    Set DB = singleton
End Property

%REM
    Sub crash
    Description: Command used to crash a server or a client
%END REM
Sub Crash()
On Error GoTo handleError

MsgBox DB().Title

GoTo handleExit
    
handleError:
    On Error Resume Next
    
handleExit:
End Sub

 

 

A way to prevent crash is to bypass getDB error handling.

 

%REM
    Function getDB
    Description: Return an error
    Return : NotesDatabase
%END REM
Function getDB As NotesDatabase
On Error GoTo handleError

    Dim rc As NotesDatabase

Error 1000, "test crash"

GoTo handleExit
    
handleError:
    On Error Resume Next

resume handleExit


handleExit:
    Set getDB = rc
End Function

 

But it isn't a valid solution.

In this case we lose all error handling.

Moreover all functions behavior depends on what is the calling proc.


This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal